from django.urls import path, include
from rest_framework.routers import SimpleRouter
from . import views

router = SimpleRouter(trailing_slash=False)
router.register(r'terminal/pc/stats', views.PCTerminalViewSet)
router.register(r'terminal/risk/stats', views.TerminalRiskViewSet)
router.register(r'terminal/stats', views.TerminalViewSet)
# router.register(r'terminal/device/stats', views.TerminalDeviceView)  # retrieve 方法返回个数据详情
router.register(r'app/list', views.AppListViewSet)
# router.register(r'resource/list', views.ResourceListViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('app/visit', views.AppVisitCountView.as_view()),           # 应用总访问量
    path('app/visit/history/<int:pk>', views.AppVisitHistoryV2.as_view()),  # 单个应用访问历史记录
    path('app/visit/trend', views.app_visit_trend),                 # 应用访问趋势
    path('terminal/geotrack', views.TerminalTrackView.as_view()),   # 终端地理轨迹
    path('terminal/malware/<str:maltype>', views.TerminalMalwareView.as_view()),
    path('data/email', views.email_attachment_count),               # 邮件含附件发送量
    path('data/strategy/detail', views.strategy_triggering_trend),  # 策略触发情况
    path('data/url', views.url_visit_count),                        # URL访问量
    path('data/filedownload', views.file_download_count),           # 文件下载量
    path('data/fileshare', views.file_share_count),                 # 文件分享量
    path('data/urlshare', views.url_share_count),                   # URL分享量
    path('data/file', views.FileView.as_view()),                    # 文件列表
    path('data/trend', views.DataCirculateTrendView.as_view()),     # 数据下载/分享/发送趋势
    path('data/danger/trend', views.danger_trend),                  # 恶意应用趋势
    path("data/safety_consciousness/event", views.safety_consciousness_event),  # 安全意识得分事件
    path("app/sen_mark", views.sen_mark),                           # 更改应用的敏感等级

    path('terminal/device/stats', views.get_device_info),           # 设备的
    path('device/loopholerisk', views.loophole_risk),               # 设备的漏洞风险
    path('device/loopholerisk/count', views.loophole_risk_count),   # 设备的漏洞风险数量统计
    path('device/programsrisk', views.programs_risk),               # 设备的恶意代码风险
    path('device/programsrisk/count', views.programs_risk_count),   # 设备的恶意代码风险数量统计
    path('device/attackdetection', views.attack_detection),         # 设备的入侵检测
    path('device/basicsafety', views.basic_safety),                 # 设备的安全基线
    path('device/appsrisk', views.get_apps_risk),                   # 移动端风险详情
    path('device/appsrisk/count', views.get_apps_risk_count),                   # 移动端风险详情数量统计
]
